import java.util.Random;

/**
 * @ClassName MathMax
 * @Description: TODO
 * @Author: MaykkSTAR@163.com
 */
public class MathMax {
    public static void main(String[] args) {
        int[] arr = new int[10];
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextInt(100);
        }
        for (int j : arr) {
            System.out.print(j + " ");
        }
        int tmp = 0;
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                tmp = Math.max(tmp,Math.max(arr[i], arr[j]));
            }
        }
        System.out.print("\n" + tmp + "  ");
    }
}
